package cn.lotusnut.rabbitmqboot.dead;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Author JiangMing Zhou
 * @Date 2022/12/1 16:18
 * @Version 1.8
 */
@Component
public class DeadProvider {
    @Resource
    private AmqpTemplate amqpTemplate;

    public void sendMessage(String message) {
        System.out.println("死信生产者发送时间：" + new Date());
        amqpTemplate.convertAndSend("business_exchange", "business", message);
    }

}
